package com.ruoyi.dl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dl.mapper.DlNoticeMapper;
import com.ruoyi.dl.domain.DlNotice;
import com.ruoyi.dl.service.IDlNoticeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-28
 */
@Service
public class DlNoticeServiceImpl implements IDlNoticeService 
{
    @Autowired
    private DlNoticeMapper dlNoticeMapper;

    /**
     * 查询公告
     * 
     * @param id 公告ID
     * @return 公告
     */
    @Override
    public DlNotice selectDlNoticeById(Long id)
    {
        return dlNoticeMapper.selectDlNoticeById(id);
    }

    /**
     * 查询公告列表
     * 
     * @param dlNotice 公告
     * @return 公告
     */
    @Override
    public List<DlNotice> selectDlNoticeList(DlNotice dlNotice)
    {
        return dlNoticeMapper.selectDlNoticeList(dlNotice);
    }

    /**
     * 新增公告
     * 
     * @param dlNotice 公告
     * @return 结果
     */
    @Override
    public int insertDlNotice(DlNotice dlNotice)
    {
        dlNotice.setCreateTime(DateUtils.getNowDate());
        return dlNoticeMapper.insertDlNotice(dlNotice);
    }

    /**
     * 修改公告
     * 
     * @param dlNotice 公告
     * @return 结果
     */
    @Override
    public int updateDlNotice(DlNotice dlNotice)
    {
        return dlNoticeMapper.updateDlNotice(dlNotice);
    }

    /**
     * 删除公告对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDlNoticeByIds(String ids)
    {
        return dlNoticeMapper.deleteDlNoticeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除公告信息
     * 
     * @param id 公告ID
     * @return 结果
     */
    @Override
    public int deleteDlNoticeById(Long id)
    {
        return dlNoticeMapper.deleteDlNoticeById(id);
    }
}
